<template>
    <view class="uc-wrap uc-site-site">
        <ucHead></ucHead>


        <view class="swiper-box1">
            <swiper :indicator-dots="true" :autoplay="true" :circular="true" :interval="3000" :duration="500" class="banner" indicator-color="rgba(255, 255, 255, .3)" indicator-active-color="#fff" style="height: 400rpx;">
                <swiper-item v-for="(item,index) in companyList.bannerList" :key="index">
                    <view class="swiper-item">
                        <image src="https://my.bziyun.com/20250619/site-banner_1750323999928.png" mode="widthFix"></image>
                    </view>
                </swiper-item>
            </swiper>
        </view>
		
        <view class="title"><image src="@/static/images/site-title-1.png" mode="widthFix" class="uc-icon36"></image>企业简介</view>
        <view class="detail">
            <image :src="companyList.companyDesc" mode="widthFix"></image>
        </view>

        <view class="title"><image src="@/static/images/site-title-2.png" mode="widthFix" class="uc-icon36"></image>企业视频</view>
        <view class="video-box">
            <video id="myVideo" :src="companyList.videoUrl" @error="videoErrorCallback"  enable-danmu danmu-btn controls></video>
            <!-- <view class="name">企业宣传片</view> -->
        </view>
        <view class="list2">
            <navigator class="item" url="" hover-class="none" v-for="(item,index) in companyList.publicizeVideoList" :key="index">
                <view class="img-box">
                    <!-- <view class="img"><image :src="item" mode="aspectFill"></image></view> -->
					<video id="myVideo" :src="item" @error="videoErrorCallback"  enable-danmu danmu-btn controls></video>
                    <!-- <image src="@/static/images/play-2.png" mode="widthFix" class="play"></image> -->
                </view>
                <!-- <view class="name">影院式大屏改造</view> -->
            </navigator>
        </view>
        


        <view class="title"><image src="@/static/images/site-title-3.png" mode="widthFix" class="uc-icon36"></image>企业荣誉</view>
        <view class="swiper-box2">
            <swiper :indicator-dots="true" :autoplay="true" :circular="true" :interval="3000" :duration="500" class="banner" indicator-color="rgba(255, 255, 255, .3)" indicator-active-color="#fff" style="height: 360rpx;">
                <swiper-item v-for="(item,index) in [companyList.honorUrl]" :key="index">
                    <view class="swiper-item">
                        <image :src="item" mode="widthFix"></image>
                    </view>
                </swiper-item>
            </swiper>
        </view>
        <view class="title"><image src="@/static/images/site-title-5.png" mode="widthFix" class="uc-icon36"></image>客片拍摄服务</view>
        <view class="video-box" v-if="companyList.customerServiceVideo.indexOf(',') !=-1">
            <!-- <video id="myVideo" v-for="(item,index) in companyList.customerServiceVideo.indexOf(',') !=-1?companyList.customerServiceVideo.split(','):[]" :key="index" :src="item" @error="videoErrorCallback"  enable-danmu danmu-btn controls></video> -->
        </view>
        <!-- <view class="list2">
            <navigator class="item" url="" hover-class="none" v-for="(item,index) in companyList.customerServiitemceVideo.indexOf(',') !=-1?companyList.customerServiceVideo.split(','):[]" :key="index">
                <view class="img-box">
                    <view class="img">
						<image src="https://my.bziyun.com/20250619/site-img-9_1750325511475.png" mode="aspectFill"></image>
					</view>
                </view>
                <view class="name">影院式大屏改造</view>
            </navigator>
        </view> -->



        <view class="title"><image src="@/static/images/site-title-6.png" mode="widthFix" class="uc-icon36"></image>服务承诺</view>
        <view class="detail">
            <image :src="companyList.promise" mode="widthFix"></image>
        </view>


        <view class="title"><image src="@/static/images/site-title-7.png" mode="widthFix" class="uc-icon36"></image>投影产品</view>
        <view class="swiper-box2">
            <swiper :indicator-dots="true" :autoplay="true" :circular="true" :interval="3000" :duration="500" class="banner" indicator-color="rgba(255, 255, 255, .3)" indicator-active-color="#fff" style="height: 360rpx;">
                <swiper-item v-for="(item,index) in companyList.product.indexOf(',') !=-1?companyList.product.split(','):[]" :key="index">
                    <view class="swiper-item">
                        <image :src="item" mode="widthFix"></image>
                    </view>
                </swiper-item>
            </swiper>
        </view>
        <view class="title"><image src="@/static/images/site-title-8.png" mode="widthFix" class="uc-icon36"></image>酒店改造专家</view>
        <view class="swiper-box2">
            <swiper :indicator-dots="true" :autoplay="true" :circular="true" :interval="3000" :duration="500" class="banner" indicator-color="rgba(255, 255, 255, .3)" indicator-active-color="#fff" style="height: 360rpx;">
                <swiper-item v-for="(item,index) in companyList.renovationExpert.indexOf(',') !=-1?companyList.renovationExpert.split(','):[]" :key="index">
                    <view class="swiper-item">
                        <image :src="item" mode="widthFix"></image>
                    </view>
                </swiper-item>
            </swiper>
        </view>
        <view class="box-brand">
            <view class="name-box">知名<text class="uc-b">合作伙伴</text></view>
            <view class="img-box">
                <image :src="companyList.partner" mode="widthFix"></image>
            </view>
        </view>




        <!-- <view class="title"><image src="@/static/images/site-title-8.png" mode="widthFix" class="uc-icon36"></image>足浴店改造专家</view>
        <view class="swiper-box2">
            <swiper :indicator-dots="true" :autoplay="true" :circular="true" :interval="3000" :duration="500" class="banner" indicator-color="rgba(255, 255, 255, .3)" indicator-active-color="#fff" style="height: 360rpx;">
                <swiper-item v-for="(item,index) in 3" :key="index">
                    <view class="swiper-item">
                        <image src="https://my.bziyun.com/20250619/site-banner-3_1750324093284.png" mode="widthFix"></image>
                    </view>
                </swiper-item>
            </swiper>
        </view> -->
<!--        <view class="box-brand">
            <view class="name-box">知名<text class="uc-b">合作足浴</text></view>
            <view class="img-box">
                <image src="https://my.bziyun.com/20250619/site-img-3_1750325578390.png" mode="widthFix"></image>
            </view>
        </view> -->
        <view class="title"><image src="@/static/images/site-title-10.png" mode="widthFix" class="uc-icon36"></image>投影改造流程</view>
        <view class="scroll-box3" v-if="companyList.transformation && companyList.transformation.length>0">
            <scroll-view scroll-x="true" class="scrollViewX" scroll-with-animation="true">
                <view class="item" v-for="(item,index) in companyList.transformation" :key="index">
                    <image :src="item" mode="widthFix"></image>
                </view>
            </scroll-view>
        </view>
        


        <view class="title"><image src="@/static/images/site-title-11.png" mode="widthFix" class="uc-icon36"></image>企业宣传册</view>
        <view class="list3" v-if="companyList.corporateBrochure && companyList.corporateBrochure.length>0">
            <view class="item" v-for="(item,index) in companyList.corporateBrochure" :key="index" @click="yuLanPdf">
                <view class="img"><image :src="item" mode="aspectFill"></image></view>
                <view class="btm">
                    <!-- <view class="txt">立即阅读 <text class="uc-font uc-arrow-right"></text></view> -->
                </view>
            </view>
        </view>




    </view>
<!--    <navigator class="g-fixedService" url="" hover-class="none">
        <view class="face">
            <image src="https://my.bziyun.com/20250619/face_1750325367141.png" mode="aspectFill"></image>
        </view>
        <view class="txt">咨询</view>
    </navigator> -->
    <ucFoot :selectIndex="3"></ucFoot>
</template>
<script setup>
	import { useMainStore } from '@/store/index.js'
	import { ref } from 'vue'
	const mainStore= useMainStore();
	
	//获取当前登录信息
	const userObj = ref({})
	userObj.value = mainStore.userInfoObj
	
	//获取公司信息
	const companyList = ref(null)
	const getcompanyInfo = ()=>{
		uni.request({
			url: `https://muyin-pc.51wephone.cn/app-api/front/card/getCompany?id=${userObj.value.companyId}`, 
			method: 'GET', 
			data: { 
			},
			header:{
				"TOKEN":mainStore.userInfo.token,
			},
			success: (res) => {
				console.log('请求成功:', res.data);
				companyList.value = res.data.data
			},
			fail: (err) => {
				console.error('请求失败:', err);
			}
		});
	}
	getcompanyInfo()

    const videoErrorCallback = param =>{
        // uni.showModal({
        //     content: e.target.errMsg,
        //     showCancel: false
        // })
    }
	const yuLanPdf = ()=>{
		uni.downloadFile({
		  url: 'https://my.bziyun.com/M10-产品介绍.pdf', // 你的 PDF 文件地址（必须为 https）
		  success: (res) => {
		    if (res.statusCode === 200) {
		      uni.openDocument({
		        filePath: res.tempFilePath,
		        fileType: 'pdf',
		        success: () => {
		          console.log('打开成功');
		        },
		        fail: (err) => {
		          console.error('打开失败', err);
		        }
		      });
		    }
		  },
		  fail: (err) => {
		    console.error('下载失败', err);
		  }
		});
	}
</script>